package models

import (
	"3rd/mongo"
//	"3rd/utils/push"
	"github.com/astaxie/beego/logs"
	"github.com/revel/revel"
//	"time"
	"os"
)

var (
	db_data = "data"
	
	col_minute = "minute"
	//db_hour = "hour"
	col_hour = "hour"
	
	//db_day = "day"
	col_day = "day"
	
	//db_month = "month"
	col_month = "month"

	Log *logs.BeeLogger
)

func Init() {
	mongoConn := revel.Config.StringDefault("mongo", "root:123456@localhost:27017")
	mongo.InitMongo(mongoConn)

	Log = logs.NewLogger(10000)
	Log.SetLogger("console", "")
	Log.EnableFuncCallDepth(true)

// TODO: hack
	os.MkdirAll("c:/logs/dataPublisher", os.ModeDir)
	Log.SetLogger("file", `{"filename":"` + "c:/logs/dataPublisher/dataPublisher.log" +`"}`)
	Log.SetLogger("smtp", revel.Config.StringDefault("beelog.smtp", ""))
}
